<div class="main clearfix">
	<div class="main_inner">

		{if $item.ads}<div class="qc qc_32">{get_ads id=32}</div>{/if}

		<div class="breadcrumbs">
			<?= $this->load->view('widget/breadcrumb', $breadcrumbs); ?>
		</div>
		<div class="content-detail clearfix">
			<h2 class="page_title"><?= $post->title ?><?php if(!$post->approved): ?> <span class="red">(* <?= lang('unapproved') ?> )</span><?php endif ?></h2>

			{if $item.ads}<div class="qc qc_33">{get_ads id=33}</div>{/if}

			<div class="small_detail">
				<?php
					$post->date_display = ($post->published_up > $post->created_time)? $post->published_up : $post->created_time;
				?>
				<p class="time">Đăng bởi <strong><a href="<?= siteUrl('post/user/'.$creator->id) ?>"><?= $creator->fullname ?></a></strong> | <?= mdate(lang('date_format_lc'), strtotime($post->date_display)) ?> | Xem: <?= $post->hit ?></p>
				
				<div class="social clearfix">
					<span class="text">Thích và chia sẻ bài viết này trên: &nbsp; </span>
					<span class="fb"><fb:like layout="button_count" action="like" show_faces="false" share="true"></fb:like></span>

					<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

					<a href="https://twitter.com/share" class="twitter-share-button" data-url="{$full_url}" data-via="sucoltech">Tweet</a>
					<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

					<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'vi'}</script>
					<span class="g-plusone" data-size="medium"></span>
				</div>
			</div>
			{if $related}
				<ul class="related">
				{foreach from=$related item=itm}
					<li><a href="{router->item item=$itm}">{$itm.title}</a></li>
				{/foreach}
				</ul>
			{/if}
			
			<div class="des-detail">
				<p class="intro"><?= $post->description ?></p>

				{if $page_break<=3}
					{if $page>1}
						<div class="breakpage" style="text-align: center; font-weight: bold;margin: 10px 0;">
							<span style="background: #fafafa;padding: 10px; 15px;display: inline-block;"><a href="{router->item item=$item}{if $page>2}?p={$page-1}{/if}"><< Xem trang trước</a></span>
						</div>
						<h4>Trang {$page}:</h4>
					{/if}
				{/if}
				<div class="post_content">
					<?= $post->content ?>
				</div>
				{if $page_break>0 and $page_break<=3}
					<div class="breakpage" style="text-align: center; font-weight: bold;margin: 10px 0;">
						{if $page>1}
							<span style="background: #fafafa;padding: 10px; 15px;display: inline-block;"><a href="{router->item item=$item}{if $page>2}?p={$page-1}{/if}"><< Xem trang trước</a></span>
						{/if}
						{if $page<=1 or ($page>1 and $page_break>$page)}
							<span style="background: #fafafa;padding: 10px 15px;display: inline-block;"><a href="{router->item item=$item}?p={$page+1}">>> Xem tiếp trang sau</a></span>
						{/if}
					</div>
				{elseif $page_break>3 and $page>1}
					<div class="breakpage" style="text-align: center; font-weight: bold;;margin: 10px 0;">
						<span style="background: #fafafa;padding: 10px 15px;display: inline-block;"><a href="{router->item item=$item}"><< Quay lại</a></span>
					</div>
				{/if}
				<!-- <p class="source">{if $item.source}Nguồn: {$item.source}{/if}</p>  !-->

				{if $item.ads}<div align="center" class="qc qc_30">{get_ads id=30}</div>{/if}
				{if $item.ads}<div class="qc qc_31">{get_ads id=31}</div>{/if}
				{if $item.tag|@count}
					<div class="tag">Tags: 
					{foreach item=tag from=$item.tag}
						<a href="{router->tag tag=$tag}">{$tag}</a>
					{/foreach}
					</div>
				{/if}
			</div>
			{if !empty($recommend)}
			<div class="postRecommend">
				<h2>Nên đọc</h2>
				<div class="postItems clearfix">
					{foreach from=$recommend item=itm}
						{capture assign=url}{router->item item=$itm}{/capture}
						<div class="item">
							<div class="postImage">
								<a href="{$url}">
									<img alt="{$itm.title|escape}" src="{thumb file=$itm.img x=275 y=187}" />
								</a>
							</div>
							<div class="postText">
								<h3><a href="{$url}">{$itm.title}</a></h3>
							</div>
						</div>
					{/foreach}
				</div>
			</div>
			{/if}

			{if $item.ads}<div class="qc qc_34">{get_ads id=34}</div>{/if}

			<div class="as_like"></div>
			<div class="social clearfix">
				<span class="text">Thích và chia sẻ bài viết này trên: &nbsp; </span>
				<span class="fb"><fb:like layout="button_count" action="like" show_faces="false" share="true"></fb:like></span>

				<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

				<a href="https://twitter.com/share" class="twitter-share-button" data-url="{$full_url}" data-via="sucoltech">Tweet</a>
				<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

				<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: 'vi'}</script>
				<span class="g-plusone" data-size="medium"></span>
			</div>
			<div class="clr"></div>
			
			<div class="comments">
				<h3>Bình luận</h3>
				<div class="fb-comments" data-width="100%" data-href="{$url_current}" data-numposts="1" data-colorscheme="light"></div>
			</div>

			{if $recommend_slide}
			<div class="slideshow clearfix">
				<h3><a href="{router->item item=$recommend_slide.item}">{$recommend_slide.item.title}</a></h3>
				<div class="postItems clearfix" id="owl-slideshow">
					{foreach from=$recommend_slide.slide item=itm key=k}
						<div class="item">
							<div class="postImage">
								<img alt="{$itm.title|escape}" src="{thumb file=$itm.image x=791 y=593}" />
							</div>
							<div class="postText">
								<h4>{$k+1}. {$itm.title}</h4>
								<p class="description">{$itm.content}</p>
							</div>
						</div>
					{/foreach}
				</div>
			</div><!-- slideshow -->
			{elseif !empty($recommend_video)}
				<div class="news_videos_recommend">
					<h2><strong>Video</strong> có thể bạn quan tâm</h2>
					<div class="videoItems clearfix">
					{foreach from=$recommend_video item=itm}
					{capture assign=url}{router->item item=$itm}{/capture}
						<div class="item">
								<div class="thumb">
									<a href="{$url}"><img title="{$itm.title|escape}" src="http://img.youtube.com/vi/{$itm.link_youtube}/0.jpg" /></a>
									<a href="{$url}"><span class="play"></span></a>
								</div>
							<div class="details">
								<h3 class="title"><a href="{$url}">{$itm.title}</a></h3>
							</div>
						</div>
					{/foreach}
					</div>
				</div>
			{/if}

			<div class="newsRelatedCat">
				<h2><span>Tin cùng chuyên mục:</span><span class="cat_name">{$category.title}</span></h2>
				<div class="newsItems clearfix">
				{assign var="i" value=0}
				{foreach from=$related_cat item=itm}
					{capture assign=url}{router->item item=$itm}{/capture}
					{if $i<4}
						<div class="item">
							<div class="postImage">
								<a href="{$url}">
									<img alt="{$itm.title|escape}" src="{thumb file=$itm.img x=183 y=143}" />
								</a>
							</div>
							<div class="postText">
								<div class="postTitle">
									<h3><a class="postMore" href="{$url}">{$itm.title}</a></h3>
								</div>
							</div>
						</div>
					{/if}
					{assign var="i" value=$i+1}
				{/foreach}
				</div>
				{capture assign=qc}{get_ads id=0}{/capture}
				<div class="clearfix{if !empty($qc)} hasAds{/if}">
					<div class="qc qc_0">{$qc}</div>
					<div class="newsLinks">
						<ul>
						{assign var="i" value=0}
						{foreach from=$related_cat item=itm}
							{capture assign=url}{router->item item=$itm}{/capture}
							{assign var="i" value=$i+1}
							{if $i>=4}
								<li><a href="{$url}">{$itm.title}</a></li>
							{/if}
						{/foreach}
						</ul>
					</div>
				</div>
			</div>
			{if !empty($related_video_cat)}
			<div class="videoRelatedCat clearfix">
				<h2><span><strong>Video</strong> cùng chuyên mục</span></h2>
				<div class="videoItems clearfix">
					{foreach from=$related_video_cat item=itm}
						{capture assign=url}{router->item item=$itm}{/capture}
						<div class="item">
								<div class="thumb">
									<a href="{$url}">
										<img alt="{$itm.title|escape}" src="http://img.youtube.com/vi/{$itm.link_youtube}/0.jpg" />
										<span class="play"></span>
										</a>
								</div>
							<div class="details">
								<h3 class="title"><a href="{$url}">{$itm.title}</a></h3>
							</div>
						</div>
					{/foreach}
				</div>
			</div>
			{else}
				<p></p>
			{/if}

		</div><!-- End content-detail !-->



	</div><!-- main_inner -->
	<div class="right">
		<?php $this->load->view('frontend/video_week'); ?>
		<p></p>
		<?php $this->load->view('frontend/sitebar'); ?>
	</div><!-- right -->
</div><!-- main -->